/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

$.fn.addScroll = function() {
    var scrollable = $("<div class='scrollable'><div class='"+$(this).attr('class')+"'></div></div>");
    $(this).after(scrollable);
    var tbl = scrollable.find(".tbl");
    $(this).find(".row.data").detach().appendTo(tbl);
    var height = 200;
    if($(this).data("max-height")){
        height = $(this).data("max-height");
    }
    scrollable.css("height", height);
    scrollable.css("width", (parseInt(tbl.width())+29)+"px");
};